/**
 ********************************************************************
 * @author roocket
 * @file    uart.h
 * @version V0.0.0
 * @date    2024/3/22
 * @brief   This file is to indicate uart functions. 
 * @attention Code file rules:
 * rule: file encoding use UTF8;
 * rule: max line length 120 characters;
 * rule: line separator \r\n;
 * rule: use clion auto code format tool.
 */
#ifndef _UART_H_
#define _UART_H_

#include <stdio.h>     
#include <stdlib.h>     
#include <unistd.h>
#include <sys/types.h> 
#include <sys/stat.h>  
#include <fcntl.h>    
#include <errno.h>      
#include <sys/time.h>
#include <time.h>
#include <string.h>
#include <termios.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <sys/time.h>  

#define msleep(x) usleep(x*1000)

/* definitions for uart */

unsigned int uart_get_baud_rate(int br_id);

int uart_init(void **port, char *name, int baud);

int uart_recv_data(void *port, void *buf, int *len);

int uart_send_data(void *port, void *__buf, int len);

#endif /* _UART_H_ */

